package com.chinaedu.oc.serv.product.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chinaedu.oc.dao.productline.CodeCreateDao;
import com.chinaedu.oc.po.productline.CodeCreate;
import com.chinaedu.oc.serv.product.ICodeCreate;

@Service("CodeCreateServ")
public class ICodeCreateImpl implements ICodeCreate {

	@Autowired
	CodeCreateDao codeCreateDao;
	
	@Override
	public int createCode(String codeType) {
		
		
		
		CodeCreate code = new CodeCreate();
		code.setCodeType(codeType);
		codeCreateDao.createNum(code);
		
		CodeCreate c = codeCreateDao.queryById(code);
		
		int num = c.getNum();
		
		return num;

	}

}
